class Game < ActiveRecord::Base
#validation for the games location has to exist
validates_presence_of :game_location

#validation for the games opponent has to exist
validates_presence_of :game_opponent

#find and show new games
def self.upcoming_games
	find(:all, :conditions => "game_date > CURRENT_TIMESTAMP()",
		   :order      => "game_date")
end
#find and show past games
def self.past_games
	find(:all, :conditions => "game_date <= CURRENT_TIMESTAMP()",
		   :order      => "game_date")
end





#format date to look like a name
def name
 game_date.to_s(:long)
end
# for the game location
def location
 game_location
end
# for the games opponent
def opponent
 game_opponent
end


#taggable plugin
acts_as_taggable

belongs_to:user


end
